﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presenters.Users;

namespace University.Workshop.Presentation.Users
{
    /// <summary>
    /// Interaction logic for PageSecondStepReadUser.xaml
    /// </summary>
    public partial class PageSecondStepReadUser : Page, ISecondStepReadUser
    {
        PresenterReadUser pInternal;
        PresenterReadSecondStep pReadSecondStep;

        public PageSecondStepReadUser(PresenterReadUser pExternal)
        {
            pInternal = pExternal;
            InitializeComponent();
            pReadSecondStep = new PresenterReadSecondStep(this);
        }

        public void Update()
        {
            pReadSecondStep.UpdateData();
        }

        public void GoNextPage()
        {

        }

        public void GoBackPage()
        {
            pInternal.GoStepOne();
        }


        #region ISecondStepReadUser Members

        public string Login
        {
            set
            {
                LoginLbl.Content = value;
            }
        }

        public int Role
        {
            set
            {
                switch (value)
                {
                    case 0: RoleLbl.Content = "Administrador";
                        break;
                    case 1: RoleLbl.Content = "Operador";
                        break;
                    case 2: RoleLbl.Content = "Presidente";
                        break;
                    case 3: RoleLbl.Content = "Tesorero";
                        break;
                    default: RoleLbl.Content = "-";
                        break;
                }
            }
        }

        public bool IsActive
        {
            set
            {
                IsActiveChkB.IsChecked = value;
                if (value)
                    IsActiveChkB.Content = "Activo";
                else
                    IsActiveChkB.Content = "Inactivo";
            }
        }

        #endregion


        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            App.Current.MainWindow.Title = "Ver Usuario";
        }

        public Model.User UserToRead
        {
            get;
            set;
        }


    }
}
